package connect3.team7;

import java.net.InetAddress;
import connect3.team7.util.IPUtil;

public class Player implements java.io.Serializable {
  private static final long serialVersionUID = 227L;
  private String name;
  private String ip_addr;

  public Player(String name) {
    super(); 
    setName(name); 
    setIpAddr();
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getName() {
    return this.name;
  }

  public void setIpAddr() {
    try {
      this.ip_addr = IPUtil.getHostIP();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public String getIpAddr() {
    return this.ip_addr;
  }
}
